package String;


import java.util.Scanner;

public class D5 {
//    实现字符串反转
//    例: 键盘输入abc  输出cba
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入一个字符串:");
        String s = scanner.next();
    // 使用StringBuilder来反转字符串
      StringBuilder reversedString = new StringBuilder(s).reverse();

        // 输出反转后的字符串
        System.out.println("反转后的字符串为: " + reversedString);
        System.out.println("不想手写代码!!!    ");
    }
}
